import http from '@/api/http'

export const transferRequestApi = {
  // 获取所有转移请求
  getAllTransferRequests() {
    return http.get('/api/transfer-requests')
  },

  // 根据ID获取转移请求
  getTransferRequestById(id) {
    return http.get(`/api/transfer-requests/${id}`)
  },

  // 根据请求号获取转移请求
  getTransferRequestByRequestNo(requestNo) {
    return http.get(`/api/transfer-requests/request-no/${requestNo}`)
  },

  // 根据用户ID获取转移请求
  getTransferRequestsByUserId(userId) {
    return http.get(`/api/transfer-requests/user/${userId}`)
  },

  // 根据来源站点获取转移请求
  getTransferRequestsByFromSiteCode(fromSiteCode) {
    return http.get(`/api/transfer-requests/from-site/${fromSiteCode}`)
  },

  // 根据目标站点获取转移请求
  getTransferRequestsByToSiteCode(toSiteCode) {
    return http.get(`/api/transfer-requests/to-site/${toSiteCode}`)
  },

  // 根据状态获取转移请求
  getTransferRequestsByStatus(status) {
    return http.get(`/api/transfer-requests/status/${status}`)
  },

  // 根据审批人获取转移请求
  getTransferRequestsByApprovedBy(approvedBy) {
    return http.get(`/api/transfer-requests/approved-by/${approvedBy}`)
  },

  // 创建转移请求
  createTransferRequest(transferRequest) {
    return http.post('/api/transfer-requests', transferRequest)
  },

  // 更新转移请求
  updateTransferRequest(id, transferRequest) {
    return http.put(`/api/transfer-requests/${id}`, transferRequest)
  },

  // 删除转移请求
  deleteTransferRequest(id) {
    return http.delete(`/api/transfer-requests/${id}`)
  },

  // 根据请求号删除转移请求
  deleteTransferRequestByRequestNo(requestNo) {
    return http.delete(`/api/transfer-requests/request-no/${requestNo}`)
  }
} 